﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Colorful.Furniture.CommonManagement;

/// <summary>
/// ASCII 从小到大排序
/// </summary>
public class ASCIIComparer : IComparer
{
    public int Compare(object x, object y)
    {
        string str1 = x as string;
        string str2 = y as string;

        if (str1 == null || str2 == null)
            throw new ArgumentException("The objects to be compared are not strings.");

        return string.Compare(str1, str2, StringComparison.Ordinal);
    }
}
